package com.qf.lanzhou.shop.api.controller;


import com.qf.lanzhou.shop.pojo.vo.BaseRespVO;

/**
 * Controller 父类
 *
 * @author
 */
public class BaseController {

    protected BaseRespVO convertSuccessResult(Object data) {
        BaseRespVO result = new BaseRespVO();
        result.setCode(BaseRespVO.CodeType.SUCCESS.getValue());
        result.setData(data);
        return result;
    }

    protected BaseRespVO convertErrorResult(String errorMsg) {
        BaseRespVO result = new BaseRespVO();
        result.setCode(BaseRespVO.CodeType.FAILED.getValue());
        result.setMsg(errorMsg);
        return result;
    }
}
